if(!require(devtools)){install.packages("devtools")} devtools::install_github("khufkens/ceipr") library(ceipr) # IMPORTANT - REPLACE THIS WITH YOUR DOWNLOAD DIR: dir <- './downloads'
year <- 2016 eu_data <- ceip_read(pollutant="ALL",sector="ALL",year = year, path = dir)
# total emissions per country, adding in the population of each EU country in the corresponding year(s): eu_totals <- ceip_add_population(ceip_totals(eu_data)) # filter out the 28 countries in the European Union: eu28_totals <- dplyr::filter(eu_totals,eu28 == "EU")
pollutants <- ceip_pollutant_meta_data() pollutants %>% map(function(p) { df <- dplyr::filter(eu28_totals,pollutant == p,sector_abbr == "NT") ceip_compare_totals(df,subject=p) })
pollutants <- ceip_pollutant_meta_data() # add the emission per person calculation (WARNING: it also changes the unit to grams!) eu28_pp <- ceip_population_emissions(eu28_totals) pollutants %>% map(function(p) { df <- dplyr::filter(eu28_pp,pollutant == p,sector_abbr == "NT") ceip_compare_pp(df,subject=p,rank=TRUE) })
Here we zoom in on specific "problematic" industries.
NOx_transport <- dplyr::filter(eu28_pp,pollutant == "NOx",sector_abbr == "F") ceip_compare_pp(NOx_transport,subject="Road tranport - NOx",rank=TRUE)
CO_aviation <- dplyr::filter(eu28_pp,pollutant == "CO",sector_abbr == "H") ceip_compare_pp(CO_aviation,subject="Aviation - CO",rank=TRUE)
NOx_transport_data <- dplyr::filter(eu_data,pollutant == "NOx",sector_abbr == "F",iso2 %in% c("BE","FR","NL","LU","GB","DE","IE")) NOx_raster <- convert_to_raster(NOx_transport_data,trim = TRUE) raster::plot(NOx_raster,maxpixels=624000)
CO_aviation_data <- dplyr::filter(eu_data,pollutant == "CO",sector_abbr == "I",iso2 %in% c("BE","FR","NL","LU","GB","DE","IE")) CO_raster <- convert_to_raster(CO_aviation_data,trim = TRUE) raster::plot(CO_raster,maxpixels=624000)
vehicle_shares <- eurostat::get_eurostat("sdg_09_50")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.